package com.gc.frontend.service.impl;

import java.util.List;

import com.gc.common.mapper.HistoryPositionBusinessMapper;
import org.springframework.beans.factory.annotation.Autowired;

import com.gc.common.dto.HistoryDTO;
import com.gc.common.entity.History;
import com.gc.common.mapper.HistoryMapper;
import com.gc.frontend.service.HistoryService;
import org.springframework.stereotype.Service;

/**
 * @author 章瑱彬
 *         电话：15914921094
 *         QQ：562800930
 * @since 2015年4月2日
 */
@Service
public class HistoryServiceImpl implements HistoryService {

    @Autowired
    private HistoryMapper historyMapper;

    @Autowired
    private HistoryPositionBusinessMapper historyPositionBusinessMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return this.historyMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(History record) {
        return this.historyMapper.insert(record);
    }

    @Override
    public int insertSelective(History record) {
        return this.historyMapper.insertSelective(record);
    }

    @Override
    public History selectByPrimaryKey(Integer id) {
        return this.historyMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(History record) {
        return this.historyMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(History record) {
        return this.historyMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<History> selectByDTO(HistoryDTO dto) {
        return this.historyMapper.selectByDTO(dto);
    }

    @Override
    public int deleteInIds(String ids) {
        this.historyPositionBusinessMapper.deleteInHistoryIds(ids);
        return this.historyMapper.deleteInIds(ids);
    }

    @Override
    public int deleteInCarImeis(String carImeis) {
        this.historyPositionBusinessMapper.deleteInCarIds(carImeis);
        return this.historyMapper.deleteInCarImeis(carImeis);
    }

    @Override
    public List<History> selectLatestHistorys() {
        return this.historyMapper.selectLatestHistorys();
    }

    @Override
    public List<History> selectHistoryByCarImei(String carImei) {
        return this.historyMapper.selectHistoryByCarImei(carImei);
    }

    @Override
    public History selectLatestHistoryByImei(String carImei) {
        return this.historyMapper.selectLatestHistoryByImei(carImei);
    }
}
